import React from "react";
import { Button } from "antd";
import { PlusOutlined, EditOutlined, DeleteOutlined, CloudUploadOutlined } from '@ant-design/icons';
import { authButton } from "@/common";


/**
 * @description 功能区 例如：新建 导出 等功能
 * @param {config} config 配置可以传入一些需要的其他参数或者元素 注意，此参数是一个Object 对象 
 * */
const getActoinPanel = (config = Object) => {
    const { editProductForm = Function } = config;
    const actionConfig = [
        {
            render: (newSelectRows = [], key) => <Button key={key}
                onClick={() => {
                    // let object = { ...params, ...getSerachFormData() }
                    console.log("当前的导出条件：", object);
                }}
                type="primary" icon={<CloudUploadOutlined />} >导入</Button>
        },
        {
            icon: <EditOutlined />,
            type: "",
            text: "新增",
            show:authButton("product:list:add"),
            onClick: () => editProductForm({ type: "add" })
        },
    ];
    return actionConfig;
}
export default getActoinPanel;